<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@include file="ValidarSession.jsp"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Consultar Bastanteo</title>

<script>
function validar(){
var ruc = document.formcbastanteo.txtruc.value;

if (ruc == ""){
alert("Ingrese RUC del cliente");
return false;
}

return true;
}


</script>  
 
<link href="css/stylescheet.css" rel="stylesheet" type="text/css" />
</head>

<body  >
<%@page import="java.util.*, java.util.Collection, java.util.Iterator, bastanteo.negocio.GrupoNegocio, bastanteo.negocio.PoderNegocio, bastanteo.modelo.Poder, bastanteo.modelo.Bastanteo, bastanteo.modelo.GrupoBastanteo" %>
             
                <!-- work-->
			<form id="formcbastanteo" name="formUser" onsubmit="return validar();" action="BastanteoServlet"> 
				<input type="hidden" id="txtConsulta" name="txtConsulta" value="C"/>    
                  <table width="100%">
				<tr>     
                <td colspan="2" valign="top">
     
                <div class="title">Consultar Bastanteo</div>                </td>
                </tr>
                <tr>
                  <td width="19%" valign="top">&nbsp;</td>
                  <td width="81%" align="left">&nbsp;</td>
                </tr>
                <tr>
                  <td valign="top">RUC Cliente</td>
                  <td align="left"><input type="text" name="txtruc" id="txtruc" /></td>
                </tr>
                <tr>
                  <td valign="top">&nbsp;</td>
                  <td align="left"><label>
                    <input type="submit" name="Grabar" id="Grabar" value="Enviar" />
                  </label></td>
                </tr>     
                </table>	
                <table border="1">
                <%
	                if(request.getAttribute("colbastanteo")!=null){
	                %>
	                <tr>
					  <td style="font-weight:bold">Codigo Bastanteo</td>
					  <td style="font-weight:bold" >Grupo</td>
					  <td style="font-weight:bold" >Poder</td>
					  <td style="font-weight:bold" >Combinacion</td>
					  <td style="font-weight:bold" >Fecha Vigencia</td>
					  <td style="font-weight:bold" >Forma</td>
					  <td style="font-weight:bold" >Importe</td>	
					  </tr>	
	                <%
	                Collection<Bastanteo> cb = (Collection<Bastanteo>)request.getAttribute("colbastanteo");
                	Iterator<Bastanteo> iteradorGB = cb.iterator();
                	int i=0;
                	while(iteradorGB.hasNext()) {
                		i++;
                		Bastanteo z = (Bastanteo)iteradorGB.next();
					%>  
					<tr>
					  <td ><%=z.getCodBastanteo() %></td>
					  <td ><%=z.getCodGrupo() %></td>
					  <td ><%=z.getCodPoder() %></td>
					  <td ><%=z.getCombinacion() %></td>
					  <td ><%=z.getFecVigencia() %></td>
					  <td ><%=z.getForma() %></td>
					  <td ><%=z.getImporte() %></td>	
					  </tr>				  
					<% } 
					if(i==0){%>						
						<tr>
					  		<td colspan=7>No hay coincidencias</td>
					  	</tr>
					<% }  
	                } %>
                </table>	
     </form>
              <!--Work-->   
</body>
</html>